﻿// -------------------------------------------------------------------------
//    @FileName         :    NFCityNeighborGrid.h
//    @Author           :    Gao.Yi
//    @Date             :    2025-09-17
//    @Email			:    445267987@qq.com
//    @Module           :    NFCityNeighborGrid
//    @Desc             :
//
// -------------------------------------------------------------------------

#pragma once

#include "NFCityMapGrid.h"
#include "NFCityWorldObjectFunc.h"
#include "NFComm/NFObjCommon/NFObject.h"
#include "NFComm/NFShmStl/NFShmVector.h"
#include "NFLogicCommon/NFCommMacros.h"

class NFCityNeighborGrid
{
public:
    NFCityNeighborGrid();
    virtual ~NFCityNeighborGrid();
    int CreateInit();
    int ResumeInit();

public:
    int AddGrid(int iGridId);
    int GetGridNum() const { return m_aiGridID.size(); }
    int GetGridObjID(int iIdx) const;

    virtual int IntersectGrids(NFCityNeighborGrid& otherGrids, NFCityNeighborGrid& gridsOriginal, NFCityNeighborGrid& gridsOther);

    virtual int IterateGrids(NFICityWorldObjectFunc* pFunc, ECityWorldListType eListType = ECITYWLT_ALL);

    bool IsInNeighbor(int iGridID);

private:
    NFShmVector<int, MAX_NEIGHBOR_GRID_NUM> m_aiGridID;
};
